//
//  HTOrderLineCell.m
//  TruckDriver
//
//  Created by Ting Han on 2017/9/26.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTOrderLineCell.h"
#import "UIView+Layout.h"

@interface HTOrderLineCell()
@property (weak, nonatomic) IBOutlet UILabel *startLabel;
@property (weak, nonatomic) IBOutlet UILabel *destinLabel;
@property (weak, nonatomic) IBOutlet UILabel *numLabel;
@property (weak, nonatomic) IBOutlet UILabel *totalNumLabel;
@property (weak, nonatomic) IBOutlet UIView *redView;

@end

@implementation HTOrderLineCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.redView.layer.masksToBounds = YES;
    self.redView.layer.cornerRadius = self.redView.width/2.0;
}
- (void)setLineModel:(HTOrderLineModel *)lineModel{
    _lineModel = lineModel;
    self.startLabel.text = lineModel.fromaddr;
    self.destinLabel.text = lineModel.toaddr;
    self.totalNumLabel.text = [NSString stringWithFormat:@"货源数%@",lineModel.number];
    if ([lineModel.nuread integerValue] <= 0) {
        self.redView.hidden = YES;
    }else{
         self.redView.hidden = NO;
         self.numLabel.text = lineModel.nuread;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
